const App = {
    mixins: [Save],//配置文件，路径/utils/mixins.js
    data() {
        return {
            loading2: false,
            loading: false,
            category: [],
            village: [],
            member: [],
            person: [],
            city: [],
            city1: [],
            qwer: [],
            // childDataForm: [],
            is: true,
            cityValue: ["230000", "232700", "232723"],
            cityValue1: [],
            is: true,
            // fileList: [],
            Source: [],

            showDialog: false,
            Grid_SerialNumberInfo: [],
        };
    },
    mounted() {

    },
    watch: {
        // childDataForm(val) {
        //     if (this.action == 'Modify') {
        //         let arr = []
        //         val.forEach(item => {
        //             item.name = item.file_nameOriginal + "（磁盘文件名:" + item.file_name + "）"

        //             if (item.Row_Status == '0') {
        //                 arr.push(item)
        //             }

        //         })
        //         this.fileList = arr;

        //     }
        // },

    },
    methods: {


        convertToCascaderFormat(items) {
            const _this = this;
            console.log(items);
            return items.map((item) => ({
                label: item.category_name,
                value: item.category_id,
                // 递归处理子节点
                children: item.children
                    ? _this.convertToCascaderFormat(item.children)
                    : [],
            }));
        },

        FileUploadsuccess(row, res, Attachment_Type) {

            this.childDataForm.push({
                uid: row.uid,
                // complaint_id: this.dataForm.Project_SerialNumber,
                file_name: res.fileName,
                file_nameOriginal: row.name,
                file_path: res.tempPath,
                file_type: res.contentType,
                Row_Status: '0'
            })
            console.log(this.childDataForm);
            console.log(row, res);
        },
        FileUploadremove(row) {
            if (!Object.keys(row).some(item => item.includes('_Original'))) {
                this.childDataForm = this.childDataForm.filter(i => i.uid != row.uid);
            } else {
                let obj = this.childDataForm.filter(i => i.attachment_id == row.attachment_id)[0];
                obj.Row_Status = '1'
            }
        },
        preview(row) {
            this.fileUrl = photo + row.file_name;
            this.showDialog = true;
        },
        download(row) {
            if (row.file_name) {
                window.location.href = photo + row.file_name;
            }
        },
    },
};
const { createApp, ref } = Vue;
const app = createApp(App);
app.use(ElementPlus, { locale: zhCn });
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
app.component('yl-upload', ylUpload);
app.component('yl-text-editor', ylTextEditor);
app.component('yl-online-preview', ylOnlinePreview);
const ElMessage = ElementPlus.ElMessage;
app.mount("#app");
